package alo.p3.work;

import alo.p3.ListNode;
//把链表的0，1二进制数转换为整数
public class getDecimalValue {
    public int getDecimalValue(ListNode head) {
        StringBuffer sb=new StringBuffer();
        while(head!=null){
            sb.append(head.getData());
            head=head.getNext();
        }
        return Integer.parseInt(sb.toString(),2);
    }
}

